import './index.scss'
import { App } from 'antd'
import { useState } from 'react'
import { useMount } from 'ahooks'
const Custom = ({ page, PageEvent }) => {
    const { modal } = App.useApp()
    const [Template, setTemplate] = useState()
    useMount(async () => {
        await import(`./Custom/${page}.jsx`)
            .then(res => {
                const Temp = res.default
                setTemplate(<Temp PageEvent={PageEvent} />)
            })
            .catch((err) => {
                console.error(err)
                modal.info({ title: '当前页面未定义!', content: `当前页面路径--${page}` })
            })
    })
    return (
        <div className='Custom'>
            {Template && Template}
        </div>
    )
}
export default Custom;